<!DOCTYPE html>
<html>
<head>
<include file="Include:meta" />
<title>项目启动表-目的地运营集团数据管理平台</title>
<include file="Include:style" />
<link rel="stylesheet" href="__PUBLIC__/mobile/css/mobiscroll.min.css">
<link rel="stylesheet" href="__PUBLIC__/mobile/css/mui.picker.css">
<style>
	.lh22{ line-height: 22px; }
</style>
</head>
<body style="background: #f3f3f3;">
<div class="header">
    <a class="menu_btn" href="javascript:;"><span class="sp1"></span><span class="sp2"></span><span class="sp3"></span></a>
	项目启动表
	<if condition="((((get_permission($qs,NULL,3)) and ($project['add_uid'] eq $login_id)) or (get_permission($qs,NULL,2) and (in_array($project['center_id'],$manage_id))) or (get_permission($qs,NULL,1))) or ($project['director_uid'] eq $login_id) or ($project['manager_uid'] eq $login_id)) and ($project['status'] eq 1)">
		<if condition="$project_bg['status'] eq 1">
			<a href="javascript:;" class="header_txt_btn lost_submit"  mid="{$project_bg['id']}" action="cancel">放弃提交</a>
		</if>
	</if>
</div>
<include file="Include:commu_menu" />
<div class="content">
    <div class="communicate_add" style="padding-bottom:64px;">
		<if condition="($project['info_id'] neq NULL)">
			<if condition="$project_bg['status'] neq 1">
			<form name='number_validate'>
				<input type="hidden" name="pid" value="{$project['id']}">
				<input type="hidden" name="id" value="{$project_bg['id']}">
				<div class="form_item">
					<div class="form_item_tit">
						基本信息
					</div>
					<div class="form_item_box">
						<ul class="choice_list">
							<li <if condition="$customer neq NULL">class="bg_li active"<else />class="bg_li"</if>>
								<button id="name" class="pro_add" name="name" type="button" readonly>新增</button>
								<div class="span clearboth">
									<if condition="$customer neq NULL">
										<foreach name="customer" item="vo"><span><a href="javascript:;"></a><input readonly value="{$vo['username']}"><input name='hide_val[]' value="{$vo['id']}" type="hidden"></span></foreach></if>
								</div>
								<if condition="$customer eq NULL"><p>请选择客户…</p></if>
							</li>
							<li class="pep_li">
							<if condition="$project_bg['project_users'] neq NULL">
								<p class="active">{$project_bg['project_users']}</p>
								<input type="hidden" tid="{$project_bg['project_uids']}" tname="{$project_bg['project_users']}" value="{$project_bg['project_users']}">
							<else />
								<p>请选择项目人员…</p>
								<input type="hidden">
							</if>
							</li>
							<li class="tz_li">
							<if condition="$project_bg['business_type_name'] neq NULL">
								<input type="text" fname="" sname="" fid="{$project_bg['business_type']}" sid=""  readonly placeholder="请填写拓展类型…" value="{$project_bg['business_type_name']}">
							<else />
								<input type="text" fname='' sname=""  fid="" sid="" readonly placeholder="请填写拓展类型…">
							</if>
							</li>
							<li class="qd_li">
							<if condition="$project_bg['channel'] neq NULL">
								<input type="text" name="channel" value="{$project_bg['channel']}" placeholder="请填写获悉渠道…">
							<else />
								<input type="text" name="channel" placeholder="请填写获悉渠道…">
							</if>
							</li>
						</ul>
					</div>
					<div class="form_item_tit">
						项目简介
					</div>
					<div class="form_item_box label_box">
						<textarea name="project_introduce" placeholder="点击填写项目简介…">{$project_bg['project_introduce']}</textarea>
					</div>
					<div class="form_item_tit">
						甲方背景
					</div>
					<div class="form_item_box label_box">
						<textarea name="party_background" placeholder="点击填写甲方背景…">{$project_bg['party_background']}</textarea>
					</div>
					<div class="form_item_tit">
						合作诉求
					</div>
					<div class="form_item_box label_box">
						<textarea name="cooperative_appeals" placeholder="点击填写合作诉求…">{$project_bg['cooperative_appeals']}</textarea>
					</div>
				</div>
				<if condition="((((get_permission($qs,NULL,3)) and ($project['add_uid'] eq $login_id)) or (get_permission($qs,NULL,2) and (in_array($project['center_id'],$manage_id))) or (get_permission($qs,NULL,1))) or ($project['director_uid'] eq $login_id) or ($project['manager_uid'] eq $login_id)) and ($project['status'] eq 1)">
					<if condition="($project_bg['status'] eq -1) or ($project_bg['status'] eq NULL)">
						<div class="build_btn paddbox"><div><button type="button" class="sub_btn main_sub disabled" disabled>提 交</button></div></div>
					</if>
				</if>
			</form>
			<else />
			<div class="form_item pt10">
				<div class="form_item_tit">
					甲方信息
				</div>
			</div>
			<div class="form_table all pb15">
				<table cellspacing="0">
					<tbody><tr>
						<td class="form_table_left" style="vertical-align:top">项目客户</td>
						<td class="form_table_right">
						<foreach name="customer" item="vo">
							<a class="customer ml10" href="javascript:;" mid="{$vo['id']}">{$vo['username']}</a>
						</foreach>
						</td>
					</tr>
				</tbody></table>
			</div>
			<div class="form_item pt10">
				<div class="form_item_tit">
					项目信息
				</div>
			</div>
			<div class="form_table all pb15">
				<table cellspacing="0">
					<tr>
						<td class="form_table_left">拓展类型</td>
						<td class="form_table_right">{$project_bg['business_type_name']}</td>
					</tr>
					<tr>
						<td class="form_table_left">获悉渠道</td>
						<td class="form_table_right">{$project_bg['channel']}</td>
					</tr>
					<tr>
						<td class="form_table_left">项目人员</td>
						<td class="form_table_right">{$project_bg['project_users']}</td>
					</tr>
					<tr>
						<td class="form_table_left">添加人</td>
						<td class="form_table_right">{$project_bg['add_user']}({$project_bg['add_date']})</td>
					</tr>
					<tr>
						<td width="70" class="form_table_left">最后操作人</td>
						<td class="form_table_right">{$project_bg['edit_user']}({$project_bg['edit_date']})</td>
					</tr>
				</table>
			</div>
			<div class="form_item pt10">
				<div class="form_item_tit">
					项目简介
				</div>
			</div>
			<div class="form_table all pb10 pt10 fz12 lh22">
				{$project_bg['project_introduce']}
			</div>
			<div class="form_item pt10">
				<div class="form_item_tit">
					甲方背景
				</div>
			</div>
			<div class="form_table all pb10 pt10 fz12 lh22">
				{$project_bg['party_background']}
			</div>
			<div class="form_item pt10">
				<div class="form_item_tit">
					合作诉求
				</div>
			</div>
			<div class="form_table all pb10 pt10 fz12 lh22">
				{$project_bg['cooperative_appeals']}
			</div>
			</if>
		<elseif condition="($project['center_id'] eq 130005)" />
			<if condition="$project_bg['status'] neq 1">
			<form name='number_validate'>
				<input type="hidden" name="pid" value="{$project['id']}">
				<input type="hidden" name="id" value="{$project_bg['id']}">
				<div class="form_item">
					<div class="form_item_tit">
						基本信息
					</div>
					<div class="form_item_box">
						<ul class="choice_list">
							<li <if condition="$customer neq NULL">class="bg_li active"<else />class="bg_li"</if>>
								<button id="name" class="pro_add" name="name" type="button" readonly>新增</button>
								<div class="span clearboth">
									<if condition="$customer neq NULL">
										<foreach name="customer" item="vo"><span><a href="javascript:;"></a><input readonly value="{$vo['username']}"><input name='hide_val[]' value="{$vo['id']}" type="hidden"></span></foreach>
									</if>
								</div>
								<if condition="$customer eq NULL"><p>请选择客户…</p></if>
								<div class="xm_box clearboth" style="display:block;">
									<foreach name="customer_c" item="vo">
										<em>{$vo['username']}<if condition="$vo['company_name'] neq NULL">【{$vo['company_name']}】</if></em>
									</foreach>
								</div>
							</li>
							<li class="tz_li">
							<if condition="$project_bg['p_type_name'] neq NULL">
								<input type="text" fname="" sname="" fid="" sid="{$project_bg['p_type']}" readonly placeholder="请填写项目类型…" value="{$project_bg['p_type_name']}">
							<else />
								<input type="text" fname='' sname="" fid="" sid="" readonly placeholder="请填写项目类型…">
							</if>
							</li>
							<li class="xm_li">
								<input type="text" name="project_name" <if condition="$project_bg['bus_id'] neq NULL">value="[{$project_c['project_num']}]{$project_c['project_name']}"</if> placeholder="拓展项目号" readonly>
								<input type="hidden" name="bus_id" value="{$project_bg['bus_id']}">
								<a href="javascript:;" <if condition="$project_bg['bus_id'] neq NULL">style="display: inline;"</if>></a>
							</li>
							<li class="je_li">
							<if condition="$project_bg['contract_money'] neq NULL">
								<input type="text" name="contract_money" value="{$project_bg['contract_money']}" placeholder="合同金额(元)">
							<else />
								<input type="text" name="contract_money" placeholder="合同金额(元)">
							</if>
							</li>
							<li class="zq_li">
							<if condition="$project_bg['cycle_date'] neq NULL">
								<input type="text" name="cycle_date" value="{$project_bg['cycle_date']-0?$project_bg['cycle_date']-0:NULL}" placeholder="项目周期(月)">
							<else />
								<input type="text" name="cycle_date" placeholder="项目周期(月)">
							</if>
							</li>
							<li class="hz_li">
							<if condition="$project_bg['cooperation_mode'] neq NULL">
								<input type="text" name="cooperation_mode" value="{$project_bg['cooperation_mode']}" placeholder="合作方式">
							<else />
								<input type="text" name="cooperation_mode" placeholder="合作方式">
							</if>
							</li>
							<li class="dj_li">
							<if condition="$project_bg['scenic_level'] neq NULL">
								<input type="text" name="scenic_level" value="{$project_bg['scenic_level']}" placeholder="景区等级">
							<else />
								<input type="text" name="scenic_level" placeholder="景区等级">
							</if>
							</li>
						</ul>
					</div>
					<div class="form_item_tit">项目阶段</div>
						<div class="form_item_box label_box">
							<if condition="(($project_bg['status'] eq -1) or ($project_bg['status'] eq NULL)) and ((((get_permission($qs,NULL,3)) and ($project['add_uid'] eq $login_id)) or (get_permission($qs,NULL,2) and (in_array($project['center_id'],$manage_id))) or (get_permission($qs,NULL,1))) or ($project['director_uid'] eq $login_id) or ($project['manager_uid'] eq $login_id)) and ($project['status'] eq 1)">
								<if condition="($opera eq 1) and ($project_bg['project_stage'] eq '已开业')">
									{$project_bg['project_stage']}
								<else/>
									<label <if condition="$project_bg['project_stage'] eq '建设期'">class="form_label w30b radio active"<else />class="form_label w30b radio"</if>><input type="radio" name="project_stage" value="建设期" <if condition="$project_bg['project_stage'] eq '建设期'">checked</if>>建设期</label>
									<label <if condition="$project_bg['project_stage'] eq '已开业'">class="form_label w30b radio active"<else />class="form_label w30b radio"</if>><input type="radio" name="project_stage" value="已开业" <if condition="$project_bg['project_stage'] eq '已开业'">checked</if>>已开业</label>
								</if>
							<else/>
								{$project_bg['project_stage']}
							</if>
						</div>
					<div class="form_item_tit">
						项目简介
					</div>
					<div class="form_item_box label_box">
						<if condition="$project_bg_c['project_introduce'] eq NULL">
							<textarea name="project_introduce" placeholder="点击填写项目简介…">{$project_bg['project_introduce']}</textarea>
							<p class="textarea">{$project_bg['project_introduce']}</p>
						<else />
							<textarea name="project_introduce"  style="display:none;" placeholder="点击填写项目简介…">{$project_bg['project_introduce']}</textarea>
							<p class="textarea" style="display:block;">{$project_bg_c['project_introduce']}</p>
						</if>
					</div>
				</div>
				<if condition="((((get_permission($qs,NULL,3)) and ($project['add_uid'] eq $login_id)) or (get_permission($qs,NULL,2) and (in_array($project['center_id'],$manage_id))) or (get_permission($qs,NULL,1))) or ($project['director_uid'] eq $login_id) or ($project['manager_uid'] eq $login_id)) and ($project['status'] eq 1)">
					<if condition="($project_bg['status'] eq -1) or ($project_bg['status'] eq NULL)">
						<div class="build_btn paddbox"><div><button type="button" class="sub_btn main_sub disabled" disabled>提 交</button></div></div>
					</if>
				</if>
			</form>
			<else />
			<div class="form_item pt10">
				<div class="form_item_tit">
					甲方信息
				</div>
			</div>
			<div class="form_table all pb15">
				<table cellspacing="0">
					<tbody><tr>
						<td class="form_table_left" style="vertical-align:top">项目客户</td>
						<td class="form_table_right">
						<foreach name="customer" item="vo">
							<a class="customer ml10" href="javascript:;" mid="{$vo['id']}">{$vo['username']}</a>
						</foreach>
						<foreach name="customer_c" item="vo">
							<a class="customer ml10" href="javascript:;" mid="{$vo['id']}">{$vo['username']}</a>
						</foreach>
						</td>
					</tr>
				</tbody></table>
			</div>
			<div class="form_item pt10">
				<div class="form_item_tit">
					项目信息
				</div>
			</div>
			<div class="form_table all pb15">
				<table cellspacing="0">
					<tbody><tr>
						<td class="form_table_left">项目类型</td>
						<td class="form_table_right">{$project_bg['p_type_name']}</td>
					</tr>
					<tr>
						<td class="form_table_left">拓展项目号</td>
						<td class="form_table_right"><if condition="$project_c['project_num'] neq NULL">[{$project_c['project_num']}]{$project_c['project_name']}</if></td>
					</tr>
					<tr>
						<td class="form_table_left">合同金额(元)</td>
						<td class="form_table_right">{$project_bg['contract_money']}</td>
					</tr>
					<tr>
						<td class="form_table_left">项目周期(月)</td>
						<td class="form_table_right"><div class="right_text">{$project_bg['cycle_date']-0?$project_bg['cycle_date']-0:NULL}</div></td>
					</tr>
					<tr>
						<td class="form_table_left">合作方式</td>
						<td class="form_table_right"><div class="right_text">{$project_bg['cooperation_mode']}</div></td>
					</tr>
					<tr>
						<td class="form_table_left">景区等级</td>
						<td class="form_table_right"><div class="right_text">{$project_bg['scenic_level']}</div></td>
					</tr>
					<tr>
						<td class="form_table_left">项目阶段</td>
						<td class="form_table_right"><div class="right_text">{$project_bg['project_stage']}</div></td>
					</tr>
					<tr>
						<td class="form_table_left">项目人员</td>
						<td class="form_table_right"><div class="right_text">{$project_bg['project_users']}</div></td>
					</tr>
					<tr>
						<td class="form_table_left">添加人(时间)</td>
						<td class="form_table_right">{$project_bg['add_user']}({$project_bg['add_date']})</td>
					</tr>
					<tr>
						<td width="70" class="form_table_left">最后操作人(时间)</td>
						<td class="form_table_right">{$project_bg['edit_user']}({$project_bg['edit_date']})</td>
					</tr>
				</tbody></table>
			</div>
			<div class="form_item pt10">
				<div class="form_item_tit">
					项目简介
				</div>
			</div>
			<div class="form_table all pb10 pt10 fz12 lh22">
				<if condition="$project_bg_c['project_introduce'] eq NULL">{$project_bg['project_introduce']}<else />{$project_bg_c['project_introduce']}</if>
			</div>
			</if>
		</if>
    </div>
</div>
<!-- 弹出框 -->
<div class="white_alert tit_alert tit_alert1" style="display: none;">
    <div class="tit">项目人员</div>
    <ul class="alert_list">
		<foreach name="user_list" item="do">
			<foreach name="do['user']" item="uo">
				<li <if condition="strstr($project_bg['project_users'],$uo['username'])">class="active"</if> tid="{$uo['id']}">{$uo['username']}</li>
			</foreach>
		</foreach>
    </ul>
    <div class="clearboth">
        <a class="modal_close2" href="javascript:;">取消</a>
        <a <if condition="$project_bg['project_users'] neq NULL">class="modal_sub float_r"<else />class="modal_sub float_r disabled"</if> href="javascript:;">确定</a>
    </div>
</div>
<!-- 弹出框 -->
<div class="Alert operate_alert bg_alert">
    <div>
        <textarea name="hb_text" maxlength="4"></textarea>
        <div class="tab_box mb10">
			<if condition="($project['center_id'] eq 130003)">
				<foreach name="bus_list" item="vo">
					<a fid="{$vo['id']}" href="javascript:;">{$vo['second_name']}</a>
				</foreach>
			<elseif condition="($project['center_id'] eq 130005)"/>
				<foreach name="ptype_list" item="vo">
					<a sid="{$vo['id']}" href="javascript:;">{$vo['second_name']}</a>
				</foreach>
			</if>
        </div>
        <div class="btn_box clearboth">
            <a class="btn_close float_l" href="javascript:;">取消</a><button class="btn_alert float_r disabled" <if condition="($project['center_id'] eq 130003)">active="1"<elseif condition="($project['center_id'] eq 130005)"/>active="2"</if> disabled>确定</button>
        </div>
        <input class="size_input" type="hidden" sid="" tid="">
    </div>
</div>
<!-- 弹出框 -->
<div class="card_fix">
    <div class="tit"><a class="back_btn" href="javascript:;"></a>添加客户</div>
    <div class="modal_body">

    </div>
</div>
<div class="customer_alert">
    <div class="alert_title"><a class="edit" href="javascript:;">编辑</a>客户详情<a class="close" href="javascript:;"><img src="__PUBLIC__/mobile/images/project/clo_icon_y.png"></a></div>
    <div class="alert_body">
        <div class="form_table">
            
        </div>
    </div>
</div>
<!-- 项目弹出框 -->
<div id="project_fix">
	<div class="picker_tit">
		<a class="back_btn" href="javascript:;"></a>选择拓展项目号
	</div>
	<section class="pro-pickers">
		<div class="search_cont animate">
			<div class="search_inp">
				<input type="input" placeholder="输入客户名查询……"><span class="animate">取消</span>
			</div>
		</div>
		<div class="search_result"></div>
		<div class="search_li">
			<ul>
				<foreach name="business" item="vo">
				<li mid="{$vo['id']}">[{$vo['project_num']}]{$vo['project_name']}</li>
				</foreach>
			</ul>
			<p>无对应数据</p>
		</div>
		<dl>
			<foreach name="business" item="vo">
			<dd mid="{$vo['id']}" data-letter="C">[{$vo['project_num']}]{$vo['project_name']}</dd>
			</foreach>
		</dl>
	</section>
</div>
<include file="Include:javascript" />
<script src="__PUBLIC__/mobile/js/mui.min.js"></script>
<script src="__PUBLIC__/mobile/js/mui.picker.min.js"></script>
<script src="__PUBLIC__/mobile/js/data.city.js"></script>
<script>
    var provinces ={$customers};
    $(function(){
		$("[name='project_name']").click(function(){
			$('#project_fix').fadeIn();
		})
		var sear_r = $('#project_fix .search_result'),
			sear_in = $("#project_fix .search_cont").find('input'),
			sear_sp = $("#project_fix .search_cont").find('span'),
			sear_ul = $("#project_fix .search_li");
		$("#project_fix .back_btn").on("click", function(e) {
			$("#project_fix,#project_fix .search_inp span").fadeOut();
			$('html,#project_fix .search_cont').removeClass('active');
			$('#project_fix .search_inp input').val('');
			$('#project_fix .search_result,#project_fix .search_li').hide();
		});
		sear_in.on("focus", function() {
			sear_r.fadeIn();
		});
		sear_sp.on("click", function() {;
			sear_in.val('');
			$(this).hide();
			$('#project_fix .search_cont,#project_fix .search_result').removeClass('active');
			$('#project_fix .search_li li').removeClass('active');
			sear_ul.hide();
			sear_r.hide();
			$('#project_fix .pro-pickers').css('overflow-y','auto');
		});
		sear_r.on("click", function() {
			sear_r.fadeOut();
			sear_ul.fadeOut();
			$('#project_fix .pro-pickers').css('overflow-y','auto');
		});
		sear_in.on('propertychange input', function () {
			var keyWord = $(this).val(),
				sli = $('#project_fix .search_li li');
				len = sli.length,
				arr = [];
			sli.removeClass('active');
			if(keyWord!=''){
				$('#project_fix .search_cont,#project_fix .search_result').addClass('active');
				sear_sp.show();
				sear_ul.fadeIn();
				$('#project_fix .pro-pickers').css('overflow','hidden');
				for(var i=0;i<len;i++){
					//如果字符串中不包含目标字符会返回-1
					var lt = sli.eq(i).html();
					if(lt.indexOf(keyWord)>=0){
					sli.eq(i).addClass('active');
					if($('#project_fix .search_li').find('.active').length!=0){
						$('#project_fix .search_li p').hide();
					}
					}else{
						if($('#project_fix .search_li').find('.active').length==0){
						$('#project_fix .search_li p').show();
					}
				}
			}
				return arr;
			}else{
				$('#project_fix .search_cont,#project_fix .search_result').removeClass('active');
				sear_sp.hide();
				sear_ul.fadeOut();
				sear_r.on("click", function() {
					sear_r.fadeOut();
				});
			}
		})
		$('#project_fix dd').click(function(){
			var text = $(this).text(),
				mid = $(this).attr('mid'),
				str='';
			$('#project_name').change();
			$("#project_fix").fadeOut();
			$('html').removeClass('active');
			$.ajax({
				type:"POST",
				async:false,
				dataType:"json",
				data:{"id":mid},
				url:"__APP__/Mobile/Project/project_bg_ajax",
				success:function(data){
					$('.xm_li a,.xm_box').show();
					for(var i=0; i<data.person.length;i++){
						if(data.person[i].company_name){
							str+= "<em>"+data.person[i].username+"【"+data.person[i].company_name+"】</em>";
						}else{
							str+= "<em>"+data.person[i].username+"</em>";
						}
					}
					$('.xm_box').html(str);
					$("[name='project_name']").val(text);
					$("[name='bus_id']").val(mid);
					$("[name='project_introduce']").val('').hide();
					$('.textarea').html(data.project_introduce).show();
					submit();
				}
			})
		})
		$('#project_fix li').click(function(){
			var text = $(this).text(),
				mid = $(this).attr('mid'),
				str='';
			$('#project_name').change();
			$("#project_fix").fadeOut();
			$('#project_fix .search_li').hide();
			$('#project_fix .search_result,#project_fix .search_inp span').hide();
			$('#project_fix .search_inp input').val('');
			$('html,#project_fix .search_cont,#project_fix .search_result').removeClass('active');
			$('#project_fix .pro-pickers').css('overflow-y','auto');
			$.ajax({
				type:"POST",
				async:false,
				dataType:"json",
				data:{"id":mid},
				url:"__APP__/Mobile/Project/project_bg_ajax",
				success:function(data){
					$('.xm_li a,.xm_box').show();
					for(var i=0; i<data.person.length;i++){
						if(data.person[i].company_name){
							str+= "<em>"+data.person[i].username+"【"+data.person[i].company_name+"】</em>";
						}else{
							str+= "<em>"+data.person[i].username+"</em>";
						}
					}
					$('.xm_box').html(str);
					$("[name='project_name']").val(text);
					$("[name='bus_id']").val(mid);
					$("[name='project_introduce']").val('').hide();
					$('.textarea').html(data.project_introduce).show();
					submit();
				}
			})
		})
		$('.xm_li a').click(function(){
			var txt = $('.textarea').text();
			$(".xm_li input,[name='bus_id']").val('');
			$(this).hide();
			$('.xm_box').hide().html('');
			$("[name='project_introduce']").show().val(txt);
			$('.textarea').html('').hide();
			submit();
		})
        menu();
		submit();
        ///提交后
        $('.customer_alert .close').click(function(){
            $('.customer_alert').fadeOut();
            $('.Mask').fadeOut(function(){
                $(this).remove();
            })
        })
		//客户详情
		$(".customer").on("click",function(){
            Mask();
			var mid = $(this).attr("mid");
			$('.customer_alert .edit').attr('mid',mid);
			$.ajax({
				type:"POST",
				async:false,
				dataType:"json",
				data:{"id":mid},
				url:"__APP__/Mobile/Project/project_card_detail",
				success:function(data){
					var html = "<table>";
					html+="<tr><td class='form_table_left'>姓名</td><td class='form_table_right'>";
					html+=data.username ? data.username : "";
					html+="</td></tr>";
					html+="<tr><td class='form_table_left'>性别</td><td class='form_table_right'>";
					html+=data.gender ? data.gender : "";
					html+="</td></tr>";
					html+="<tr><td class='form_table_left'>公司名称</td><td class='form_table_right'>";
					html+=data.company_name ? data.company_name : "";
                    html+="</td></tr>";
                    html+="<tr><td class='form_table_left'>职位</td><td class='form_table_right'>";
					html+=data.job ? data.job : "";
					html+="</td></tr>";
					html+="<tr><td class='form_table_left'>手机号</td><td class='form_table_right'>";
					html+=data.mobilephone ? data.mobilephone : "";
                    html+="</td></tr>";
                    html+="</td><td class='form_table_left'>座机号</td><td class='form_table_right'>";
					html+=data.telephone ? data.telephone : "";
					html+="</td></tr>";
					html+="</td><td class='form_table_left'>QQ</td><td class='form_table_right'>";
					html+=data.qq ? data.qq : "";
                    html+="</td></tr>";
                    html+="</td><td class='form_table_left'>邮箱</td><td class='form_table_right'>";
					html+=data.email ? data.email : "";
					html+="</td></tr>";
					html+="</td><td class='form_table_left'>地址</td><td class='form_table_right'>";
					if(data.province){
						html+=data.province+"-"+data.city;
						html+=data.address ? "-"+data.address : "";
					}else{
						html+=data.address ? data.address : "";
					}
					html+="</td></tr>";
					html+="</td><td class='form_table_left'>其他信息</td><td class='form_table_right'>";
					html+=data.remark ? data.remark : "";
					html+="</td></tr>";
					html+="</table>";
                    $(".customer_alert").find(".form_table").html(html);
                    $('.customer_alert').fadeIn();
				}
			});
		});
		//详情编辑
		$('.customer_alert .edit').click(function(){
			var mid = $(this).attr('mid');
			$('.customer_alert').fadeOut();
			$('.Mask').fadeOut(function(){
				$(this).remove();
			})
            $('.card_fix').fadeIn().find('.modal_body').load("__APP__/Mobile/Project/project_card_edit/pid/{$project['id']}/id/"+mid);
            $('.card_fix').fadeIn().find('.tit').html('<a class="back_btn" href="javascript:;"></a>编辑客户');
            $('html').addClass('active')
		})
        //标签
        $('body').on('click','.bg_li a',function(){
            $(this).parent('span').remove();
            if($('.bg_li span').length<1){
                $('.bg_li').removeClass('active');
                $('.bg_li p').show();
            }
            submit();
            
        })
        //拓展类型
        $('.tz_li').click(function(){
            Mask();
            $('.operate_alert').fadeIn().find('textarea').focus();
        })
        $('.tab_box a').click(function(){
            var txt = $(this).text(),
                fid = $(this).attr('fid'),
				sid = $(this).attr('sid');
            $('.tz_li input').val(txt).attr('fid',fid);
            $('.tz_li input').val(txt).attr('sid',sid);

            $('.Mask').fadeOut(function(){
                $(this).remove();
            });
            $('.operate_alert').fadeOut();
            submit();
			$('.tz_li input').attr('fname','');
			$('.tz_li input').attr('sname','');
        })
        $("[name='hb_text']").bind('input propertychange', function() {  
            var val = $(this).val();
            if(val!=''){
                $(".btn_alert").removeClass("disabled").attr('disabled',false);
            }else{
                 $(".btn_alert").addClass("disabled").attr('disabled',true);
            }
        })
        $(".btn_alert").click(function(){
            var txt = $("[name='hb_text']").val(),
				active = $(this).attr('active');
            if(active==1){
				$('.tz_li input').val(txt).attr('fname',txt);
			}else{
				$('.tz_li input').val(txt).attr('sname',txt);
			}
            $('.Mask').fadeOut(function(){
                $(this).remove();
            });
            $('.operate_alert').fadeOut();
            submit();
        })
        
        $('.modal_close2').click(function(){
            $(this).parents('.white_alert').fadeOut();
            $('.Mask').fadeOut(function(){
                $(this).remove();
            });
        });
        $("#name").CityPicker()
        //添加
        $('body').on("click",".add_btn",function(){
            $(".picker-box").fadeOut();
            $('.search_li li').hide();
            $('.search_result').hide();
            $('.search_inp input').val('');
            $('.card_fix').fadeIn().find('.modal_body').load("__APP__/Mobile/Project/project_card_add/pid/{$project['id']}/way/2/since/2/center_id/130003");
            $('.card_fix').fadeIn().find('.tit').html('<a class="back_btn" href="javascript:;"></a>添加客户')
        })
        //人员
        $(".pep_li p").click(function(){
            Mask();
            $(".tit_alert1").fadeIn();
        })
        $(".tit_alert1 li").click(function(){
            $(this).toggleClass('active');
            if($(".tit_alert1 li.active").length>0){
                $(".tit_alert1 .modal_sub").removeClass('disabled');
            }else{
				$(".tit_alert1 .modal_sub").addClass('disabled');
			}
        })
        $(".tit_alert1 .modal_sub").click(function(){
            var html ='',
                idhtml ='',
                active = $(".tit_alert1 li.active");
            for(var i = 0; i<active.length;i++){
                var txt = active.eq(i).text(),
                    tid = active.eq(i).attr('tid');
                html+= ""+txt+"";
                if(i<active.length-1){
                    html+= ",";
                }
                idhtml+= ""+tid+"";
                if(i<active.length-1){
                    idhtml+= ",";
                }
            }
            $(".pep_li p").html(html);
            $(".pep_li p").addClass('active');
            $(".pep_li input").attr('tid',idhtml);
            $(".pep_li input").attr('tname',html);
            $(".pep_li input").val(html);
            $(".tit_alert1").fadeOut();
            $('.Mask').fadeOut(function(){
                $(this).remove();
            });
            submit();
        })
        //建议书
        $(".jy_btn").click(function(){
            $(".Mask,.tit_alert2").fadeIn();
        })
        $(".tit_alert2 li").click(function(){
            $(this).toggleClass('active').siblings().removeClass('active');
        })
        $(".tit_alert2 .modal_sub").click(function(){
            var txt = $(".tit_alert2 li.active").text(),
                tid = $(".tit_alert2 li.active").attr('tid');
            if($(".tit_alert2 li.active").length>0){
                $(".jy_btn span").html("工作建议书-"+txt+"");
                $(".checkbox2").addClass('active');
                $(".checkbox2").find('input').prop("checked",true);
                $("[name='js_choice']").attr('tid',tid);
            }else{
                $("[name='js_choice']").attr('tid','');
            }
            $(".tit_alert2").fadeOut();
            $('.Mask').fadeOut();
        })
        $("[name='project_introduce']").blur(function(){
            submit();
		})
		$('.form_label').click(function(){
			submit();
		})
		//提交
		$('.main_sub').click(function(){
            var fid = $('.tz_li input').attr('fid'),
                sid = $('.tz_li input').attr('sid'),
                fname = $('.tz_li input').attr('fname'),
				sname = $('.tz_li input').attr('sname'),
                tid = $('.pep_li input').attr('tid'),
				tname = $('.pep_li input').attr('tname');
            $.ajax({
                type:"POST",
                async:false,
                dataType:"json",
                data:$("[name='number_validate']").serialize()+"&fid="+fid+"&sid="+sid+"&fname="+fname+"&sname="+sname+"&tid="+tid+"&tname="+tname,
                url:"__APP__/Mobile/Project/project_bg_submit",
                success:function(data){
                    success_pop(data.status,data.msg);
                }
            });
        })
		//放弃提交
		$(".lost_submit").ajaxModal({"body_text":"您确定要放弃提交吗？","url":"/dms_erp/index.php?s=/Mobile/Project/project_bg_submit","data":{"id":"mid","action":"action"}});
    })
    //提交
    function submit(){
        var tag = true;
        if($(".pep_li input").val()==''){
            tag = false;
            $('.sub_btn').addClass('disabled').attr('disabled',true);
        }
        if($(".tz_li input").val()==''){
            tag = false;
            $('.sub_btn').addClass('disabled').attr('disabled',true);
		}
        if($(".bg_li span").length==0){
            tag = false;
            $('.sub_btn').addClass('disabled').attr('disabled',true);
        }
        if($("[name='project_name']").val()==''){
			if($("[name='project_introduce']").val()==''){
				tag = false;
				$('.sub_btn').addClass('disabled').attr('disabled',true);
			}
		}
		if($('.form_label').length>0){
			if($(".form_label.active").length<1){
				tag = false;
				$('.sub_btn').addClass('disabled').attr('disabled',true);
			}
		}
        if(tag){
            $('.sub_btn').removeClass('disabled').attr('disabled',false);
        }
    }
    function bg_che(){
        $('.bg_li p').hide();
        var val_arr=$("[name='name']").val().split('【');
		var	val=val_arr[0],
            mid = $("[name='name']").attr('mid');
        $('.bg_li').addClass('active').find('.span').append("<span><a href='javascript:;'></a><input type='text' readonly value='"+val+"''><input name='hide_val[]' type='hidden' value='"+mid+"'></span>");
        submit();
    }
    function remove(){
        $('.pro-picker dd').removeClass('hide');
        $('.bg_li span').each(function(i){
            var val = $(this).find("[name='hide_val[]']").val();
            for(var s=0;s<$('.pro-picker dd').length;s++){
                var mid = $('.pro-picker dd').eq(s).attr('mid');
                if(val==mid){
                    $('.pro-picker dd').eq(s).addClass('hide');
                }
            }
        })
    }
</script>
<script src="__PUBLIC__/mobile/js/cityPicker.js"></script>
</body>
</html>